package com.lepu.app.usercenter.bean;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class BeanUserOther {

	public String UserID;
	public String Avatar;
	public String NickName;
	public String FansCount;  //粉丝数
	public String FollowCount;  //关注数
	public String Relation; //关系(1.已关注  2.互相关注 3.无关系)
	
	public String Whatsup; //个性签名   new add
	
	public static BeanUserOther parseJsonData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = (JSONObject) obj1.get("DetailInfo");
			JSONObject obj3 = (JSONObject) obj2.get("UserObject");
			result = obj3.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		BeanUserOther beanUserOther = gson.fromJson(result,new TypeToken<BeanUserOther>(){}.getType());
		return beanUserOther;
		
	}
	
	public static int parseJsonFollow(String dataString){

		int follow = 0;
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = (JSONObject) obj1.get("DetailInfo");
			follow = obj2.getInt("FollowStatus");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		return follow;
	}
}
